package com.dongdongshop.controller;

import com.dongdongshop.data.Result;
import com.dongdongshop.domain.vo.ProvincesVO;
import com.dongdongshop.service.ProvincesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("provinces")
public class ProvincesController {

    @Autowired
    private ProvincesService provincesService;

    //查询全部省信息
    @GetMapping
    public Result getProvinces(){
        List<ProvincesVO> provincesVOList = provincesService.getProvinces();
        return Result.OK().setData(provincesVOList);
    }

}
